package com.zr.dao.car;

import com.zr.vo.car.CarInfo;
import org.apache.ibatis.annotations.CacheNamespace;

import java.util.List;
@CacheNamespace
public interface CarInfoDao {
    int deleteByPrimaryKey(Integer id);

    int insert(CarInfo record);

    int insertSelective(CarInfo record);

    CarInfo selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CarInfo record);

    int updateByPrimaryKey(CarInfo record);

    List<CarInfo> selectAll();

    List<CarInfo> selectByCondition(CarInfo carInfo);

    /**
     * 通过车牌号获得车对象
     * @param carNumber
     * @return
     * @author 杜雨萌
     */
    CarInfo selectByCarNumber(String carNumber);

    /**
     * 通过司机姓名获得车对象
     * @param anotherOne
     * @return
     * @author 杜雨萌
     */
    CarInfo selectByDriverName(String anotherOne);

    CarInfo selectByNumber(String number);

    Integer getBussyNum();

    Integer getFreeNum();

    CarInfo selectByTicketCarNumber(String number);

    int updateCarStatus(CarInfo carInfo);
    int updateLocationByCarNumber(CarInfo carInfo);
    int updateCarStatusByNumber(CarInfo carInfo);
}